package com.skstudio.reportview;

import com.skstudio.report.ReportNetwork;
import com.skstudio.report.ReportNetwork.DataNetwork;

public class ReporterCellularThrput extends ReporterNetworkThrput {

    @Override
    public int getEntry(int row, int col) {
        if (getReportRows() > row && mNet.mDataList.size() > col) {
            DataNetwork dc = mNet.mDataList.get(col);
            switch (row) {
                case 0:
                    return (int) calcPosition(dc.mDataRxRate);
                case 1:
                    return (int) calcPosition(dc.mDataTxRate);
            }
            return 0;
        }
        return 0;
    }

    @Override
    public String getReportDescription() {
        return "Cellular Usage";
    }

    @Override
    public String getEntryHint(int col) {
        if (mNet.mDataList.size() > col) {
            ReportNetwork.DataNetwork dc = mNet.mDataList.get(col);
            String hint = String.format("Received %sk, Transmitted %sk",
                    dc.mDataRx.shiftRight(10).toString(), dc.mDataTx.shiftRight(10).toString());
            return hint;
        }
        return null;
    }
}
